﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;
using System.Web.UI.HtmlControls;

public partial class apps_ahmic_pages_AHMHRIRSF01 : System.Web.UI.Page
{
    string vappid = "AHMIC";
    string vformid = "AHMIC_AHMHRIRSF01";

    protected void Page_Load(object sender, EventArgs e)
    {
        formHeader.InnerHtml = AHMIDEAFunctions.GetFormHeader(vappid, vformid);

        // get roles
        using (DC_AHMHRIRSDataContext dc = new DC_AHMHRIRSDataContext())
        {
            var i = (from u in dc.AHMHRIRS_MEMROLEs where u.ISTATUS == 1 select u);
            StringBuilder sb = new StringBuilder("<select name=\"vrole\">");
            foreach (var item in i)
            {
                sb.Append("<option value=\"" + item.VROLEID + "\">" + item.VNAME + "</option>");
            }
            sb.Append("</select>");
            ahmhrirsf01_vroleselect.InnerHtml = sb.ToString();

            var t = (from x in dc.AHMHRIRS_TEMATYPEs where x.ISTATUS == 1 && x.VTEMATYPE!="IP" select x);
            HtmlSelect sel = (HtmlSelect)ahmhrirsf01_vtype;
            if (t != null)
            {
                foreach (var item in t)
                {
                    sel.Items.Add(new ListItem(item.VTEMANAME, item.VTEMATYPE));
                }
            }
        }


    }
}